<template>
	<view>
		<u-tabbar :value="current?current:0" @change="change" :fixed="true" :placeholder="false"
			:safeAreaInsetBottom="false">
			<u-tabbar-item v-for="(item,index) in list" :key="index" :text="item.text" :icon="item.iconPath">
			</u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	import {methods} from 'uview-ui/libs/mixin/mixin';
	export default {
		name: "bottom_navigation_bar",
		props: {
			current: Number
		},
		data() {
			return {
				list: [{
						pagePath: "/pages/account/account",
						text: "账单",
						iconPath: "home",
						selectedIconPath: "home"
					},
					{
						pagePath: "/pages/charts/charts",
						text: "图表",
						iconPath: "heart",
						selectedIconPath: "heart"
					},
					{
						pagePath: "/pages/addaccount/addaccount",
						text: "记一笔",
						iconPath: "edit-pen",
						selectedIconPath: "gift"
					},
					{	
						pagePath: "/pages/find/find",
						text: "发现",
						iconPath: "gift",
						selectedIconPath: "gift"
					},
					{
						pagePath: "/pages/my/my",
						text: "我的",
						iconPath: "gift",
						selectedIconPath: "gift"
					},
				]
			};
		},
		methods: {
			change(e) {
				// console.log(e)
				uni.switchTab({
					url: this.list[e].pagePath
				})
			},
		}
	}
</script>

<style lang="scss">

</style>
